#include "StdAfx.h"
#include "DLoaderThread.h"
#include "DWorld.h"

DLoaderThread::DLoaderThread(boost::shared_ptr<DWorld> world, const std::string& strWorldPath, bool& bLoading)
: m_world(world)
, m_strWorldPath(strWorldPath)
, m_bLoading(bLoading)
{
}

DLoaderThread::~DLoaderThread(void)
{
}

void DLoaderThread::startLoading()
{
    Launch();
}

void DLoaderThread::Run()
{
    // after loading change m_bLoading to false
    if(!m_world.lock()->load(m_strWorldPath))
    {
        assert(false);
    }

    m_bLoading = false;
}